package three;

/**
 * @Author:DarknessShadow
 * @description:多线程单例模式，线程安全
 * @date 2020/5/12 10:23
 */
public class Singleton {
    private static Singleton singleton = new Singleton();

    private Singleton(){
        System.out.println("singleton实例化了.......");
        slowdown();
    }

    public static Singleton getInstance(){
        return singleton;
    }

    private void slowdown(){
        try {
            Thread.sleep(1000);
        } catch (Exception e) {
        }
    }
}
